package com.sofwin;

import com.sofwin.pojo.SysUser;
import com.sofwin.service.UserService;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

/**
 * ClassName: test
 * Description: TODO
 * date: 2022/4/16 2:49 下午
 *
 * @author andyliu
 * @qq 115176513
 * @since JDK 1.8
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = "classpath:applicationContext.xml")
public class test {
    @Autowired
    UserService userService;
    @Test
    public void test01(){
        for(int i=0;i<101;i++){
            SysUser user = new SysUser();
            user.setUserName("admin"+i);
            user.setPwd("admin"+i);
            user.setRealName("管理员"+i);
            user.setDeptId(i<50?1:2);
            userService.saveOrUpdateUser(user);
        }
    }
}
